package com.community.service.impl;

import com.community.common.utils.DateUtils;
import com.community.common.utils.SecurityUtils;
import com.community.domain.DeptEntity;
import com.community.mapper.DeptMapper;
import com.community.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptServiceImpl implements DeptService {
    @Autowired
    private DeptMapper deptMapper;
    @Override
    public List<DeptEntity> selectDeptList(DeptEntity dept) {
        return deptMapper.selectDeptList(dept);
    }

    @Override
    public Integer addDept(DeptEntity dept) {
        dept.setCreateTime(DateUtils.getNowDate());
        dept.getCreateBy();
        return deptMapper.addDept(dept);
    }

    @Override
    public Integer updateDept(DeptEntity dept) {
        dept.setCreateTime(DateUtils.getNowDate());
        dept.getCreateBy();
        return deptMapper.updateDept(dept);
    }

    @Override
    public Integer deleteDept(Integer deptId) {
        return deptMapper.deleteDept(deptId);
    }
}
